%parameters
%
%  Description
%
%    a collection of all the parameters used in an experiment.

%%-------------------------------------------------------------------------
%% Global variables
%%-------------------------------------------------------------------------
global TotalTrials RetTrials PreTrials MaxTrials
global PosTarget diameter Gain
global MovementTimeOut 
global PreparationTime TotalLearnTrialTime TitleDisplayTime
global TaskColor TaskAngle TaskPos
global xFrame yFrame res
global cm2px
global mouseSize mouseThick
global nTask
global tBackEnd tHitEnd tFBEnd tGoEnd
global pK pR pF

%%-------------------------------------------------------------------------
%% Set parameters
%%-------------------------------------------------------------------------
res             = 3;
switch res
    case 3     % 1024*768, fMRI projector
        cm2px       = 345/13.5;
        xFrame      = 13.5*cm2px;
        yFrame      = 13.5*cm2px;
        fontSize    = 72;
    case 5     % 1280*1024, 17"
        cm2px       = 460/13.5;
        xFrame      = 13.5*cm2px;
        yFrame      = 13.5*cm2px;
        fontSize    = 80;
end

mouseSize       = 1*cm2px;
mouseThick      = 0.15*cm2px;

nTask           = 4;                % baseline, scaling, rotation, flipping

TaskColor       = [0,0,1; 0,1,0; 1,0,0; 1,0,1];    % B, G, R, P
TaskPos         = [90 90 90 90]*pi/180;   % 
TaskAngle       = [ 0 45 45 45]*pi/180;   % 
PreTrials       = 200;              % 20;
TotalTrials     = 200;              % 240;
MaxTrials       = TotalTrials*3;    % 20;
RetTrials       = 40;               % 30;
distcm          = 8;                % Distance in cm
diacm           = 2;                % Diameter in cm
PosTarget       = distcm*cm2px;     % Distance of Targets from Centre    
diameter        = diacm*cm2px;      % Size of Targets
Gain            = (xFrame/2.5)/.3;  % xFrame/{range of the glove}*2

TitleDisplayTime	= 1000;

PreparationTime     = 0;
MovementTimeOut     = 1500;
tGoEnd              = 3000;
tFBEnd              = 2000;
TotalLearnTrialTime = PreparationTime + MovementTimeOut + tFBEnd;
tHitEnd             = 1000;
tBackEnd            = 1000;

%% transformation parameters
pK                  = 1.5;
pR                  = 45*pi/180;    % rotation angle
pF                  = 90*pi/180;    % flipping angle (angle of the axis)
